package com.eistert.java.datastructure._07_Set;

import com.eistert.java.datastructure._06_BinarySearch._06_BinarySearchTree;

/**
 * @Description: 二分搜索树 集合
 * @Author: ai
 * @create: 2023-04-05 00:22
 */
public class _07_BSTSet<E extends Comparable<E>> implements _07_Set<E> {

    private _06_BinarySearchTree bst;

    public _07_BSTSet() {
        bst = new _06_BinarySearchTree<>();
    }

    @Override
    public void add(E e) {
        bst.add(e);
    }

    @Override
    public boolean contains(E e) {
        return bst.contains(e);
    }

    @Override
    public void remove(E e) {
        bst.remove(e);
    }

    @Override
    public int getSize() {
        return bst.size();
    }

    @Override
    public boolean isEmpty() {
        return bst.isEmpty();
    }
}
